
// 获取分类数据

import request from '@/utils/request'

// 1. 创建作品
export function createCreation(data) {
  return request({
    url: '/api/v1/creations/create',
    method: 'post',
    data: data,
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    timeout: 20000
  })
}

export function saveCreation(data) {
  return request({
    url: '/api/v1/creations/save',
    method: 'post',
    data: data,
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    timeout: 20000
  })
}

// 2. 更新作品状态
export function updateCreationStatus(data) {
  return request({
    url: '/api/v1/creations/update/status',
    method: 'post',
    data: data,
    timeout: 20000
  })
}

// 3. 获取分类数据
export function getClassify(data) {
  return request({
    url: '/api/v1/creations/classify',
    method: 'post',
    data: data,
    timeout: 20000
  })
}

// 4. 发送删除作品验证码
export function sendDeleteVerifyCode(data) {
  return request({
    url: '/api/v1/creations/delcode',
    method: 'post',
    data: data,
    timeout: 20000
  })
}

// 5. 删除作品
export function deleteCreation(data) {
  return request({
    url: '/api/v1/creations/delete',
    method: 'delete',
    data: data,
    timeout: 20000
  })
}

// 6. 更新作品标题
export function updateCreationTitle(data) {
  return request({
    url: '/api/v1/creations/update/title',
    method: 'put',
    data: data,
    timeout: 20000
  })
}

// 7. 更新作品分类
export function updateCreationClassify(data) {
  return request({
    url: '/api/v1/creations/update/classify',
    method: 'put',
    data: data,
    timeout: 20000
  })
}

// 8. 更新作品标签
export function updateCreationTags(data) {
  return request({
    url: '/api/v1/creations/update/tags',
    method: 'post',
    data: data,
    timeout: 20000
  })
}

// 9. 更新作品描述
export function updateCreationDesc(data) {
  return request({
    url: '/api/v1/creations/update/desc',
    method: 'put',
    data: data,
    timeout: 20000
  })
}

// 10. 上传作品封面
export function uploadCreationCover(data) {
  return request({
    url: '/api/v1/creations/upload/cover',
    method: 'post',
    data: data,
    timeout: 20000
  })
}

// 11. 获取作品详情
export function getCreationDetail(data) {
  return request({
    url: '/api/v1/creations/detail',
    method: 'post',
    data: data,
    timeout: 20000
  })
}

export function creationNoShow(data) {
  return request({
    url: '/api/v1/creations/noshow',
    method: 'post',
    data: data,
    timeout: 20000
  })
}

// 12. 获取作品列表
export function getCreationsList(data) {
  return request({
    url: '/api/v1/creations/list',
    method: 'post',
    data: data,
    timeout: 20000
  })
}

// 13. 筛选作品
export function filterCreations(data) {
  return request({
    url: '/api/v1/creations/filter',
    method: 'post',
    data: data,
    timeout: 20000
  })
}

// 14. 搜索作品
export function searchCreations(data) {
  return request({
    url: '/api/v1/creations/search',
    method: 'post',
    data: data,
    timeout: 20000
  })
}

// 15. 转移作品所有权
export function transferCreation(data) {
  return request({
    url: '/api/v1/creations/transfer',
    method: 'post',
    data: data,
    timeout: 20000
  })
}
// 16. 标签管理
export function getTag(data) {
  return request({
    url: '/api/v1/tag/filter',
    method: 'post',
    data: data,
    timeout: 20000
  })
}
